MODULES_DIR := /lib/modules/$(shell uname -r)
KERNEL_DIR := ${MODULES_DIR}/build
KERNEL_LIB_DIR := ${MODULES_DIR}/extra
#AC :=$(shell cp ../reyzar_cache/reyzar_cache_ac_automation* ./)
#AC :=$(shell cp ../../conf/acrule.conf ./)

all:
	make -C ${KERNEL_DIR} M=$$PWD;
	/bin/cp module_tcp_transform.ko $(KERNEL_LIB_DIR)
modules:
	make -C ${KERNEL_DIR} M=$$PWD $@;
modules_install:
	make -C ${KERNEL_DIR} M=$$PWD $@;
clean:
	make -C ${KERNEL_DIR} M=$$PWD $@;

# The targets below are meant for quick testing.
# If you want to install the module, see ../INSTALL.

install:
	# enable ipv6 and ipv4 forwarding
	sysctl -w net.ipv4.conf.all.forwarding=0
	# prevent martian packets from reaching the module
	sysctl -w net.ipv4.conf.all.log_martians=0
	# insert the module
	insmod module_tcp_transform.ko
	
uninstall:
	rmmod module_tcp_transform
